{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Alessandro's scratch notebook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "ICESat-2 hackweek final project \n",
    "June 16, 2020  \n",
    "Alessandro Di Bella"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Install extra python modules to\n",
    "* read polygons from WKT strings\n",
    "* access Sentinel API (we might want to create a virtual environment to avoid doing this every time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: sentinelsat in /srv/conda/envs/notebook/lib/python3.7/site-packages (0.14)\n",
      "Requirement already satisfied: requests in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (2.23.0)\n",
      "Requirement already satisfied: click in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (7.1.2)\n",
      "Requirement already satisfied: geojson>=2 in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (2.5.0)\n",
      "Requirement already satisfied: six in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (1.15.0)\n",
      "Requirement already satisfied: tqdm in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (4.46.1)\n",
      "Requirement already satisfied: html2text in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (2020.1.16)\n",
      "Requirement already satisfied: geomet in /srv/conda/envs/notebook/lib/python3.7/site-packages (from sentinelsat) (0.2.1.post1)\n",
      "Requirement already satisfied: idna<3,>=2.5 in /srv/conda/envs/notebook/lib/python3.7/site-packages (from requests->sentinelsat) (2.9)\n",
      "Requirement already satisfied: chardet<4,>=3.0.2 in /srv/conda/envs/notebook/lib/python3.7/site-packages (from requests->sentinelsat) (3.0.4)\n",
      "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /srv/conda/envs/notebook/lib/python3.7/site-packages (from requests->sentinelsat) (1.25.9)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /srv/conda/envs/notebook/lib/python3.7/site-packages (from requests->sentinelsat) (2020.4.5.1)\n"
     ]
    }
   ],
   "source": [
    "#!pip install wkt\n",
    "!pip install sentinelsat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Once deleted, variables cannot be recovered. Proceed (y/[n])?  y\n"
     ]
    }
   ],
   "source": [
    "### Clear workspace\n",
    "%reset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "### Add path to scripts\n",
    "if '/home/jovyan/leading_to_phytoplankton/scripts' not in sys.path:\n",
    "    sys.path.insert(0, '/home/jovyan/leading_to_phytoplankton/scripts')\n",
    "    \n",
    "### Import modules\n",
    "import numpy as np\n",
    "from sentinelsat import SentinelAPI\n",
    "import shapely.geometry as sg\n",
    "from astropy.time import Time, TimeDelta\n",
    "from tqdm import tqdm\n",
    "import matplotlib.pyplot as plt\n",
    "import h5py, pyproj\n",
    "import readers as rd\n",
    "from icepyx import icesat2data as ipd\n",
    "import cartopy.crs as ccrs\n",
    "import importlib\n",
    "import search_sentinels as ss\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "\n",
    "### Magic function to enable interactive plotting\n",
    "%matplotlib widget "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "### Define path to sample data\n",
    "data_loc = \"/home/jovyan/shared/leading_to_phytoplankton/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ### Download IS2 sample data\n",
    "# ## Define search parameters\n",
    "# short_name = 'ATL03'\n",
    "spatial_extent = [-110, 70, 70, 90]\n",
    "# date_range = ['2019-07-26','2019-07-26']\n",
    "# \n",
    "# region_a = ipd.Icesat2Data(short_name, spatial_extent, date_range, \\\n",
    "#                            start_time='21:35:00', end_time='21:36:00', version='002')\n",
    "# \n",
    "# print(region_a.dataset)\n",
    "# print(region_a.dates)\n",
    "# print(region_a.start_time)\n",
    "# print(region_a.end_time)\n",
    "# print(region_a.dataset_version)\n",
    "# print(region_a.spatial_extent)\n",
    "# # region_a.visualize_spatial_extent()\n",
    "# print(region_a.avail_granules())\n",
    "# print(region_a.avail_granules(ids=1))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ## Log in to EarthData\n",
    "# earthdata_uid = 'ing.a.dibella'\n",
    "# email = 'ing.a.dibella@gmail.com'\n",
    "# region_a.earthdata_login(earthdata_uid, email)\n",
    "# \n",
    "# # ## Order granule\n",
    "# region_a.download_granules(data_loc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "        lats       lons          x          y     heights            dt  conf\n",
      "0  80.004734  54.366124  8938896.0  42.220333   89.935242  4.941201e+07     0\n",
      "1  80.004744  54.366109  8938897.0  42.252739 -141.238495  4.941201e+07     0\n",
      "2  80.004736  54.366121  8938897.0  42.207047  168.690918  4.941201e+07     0\n",
      "3  80.004743  54.366112  8938897.0  42.228359   16.640863  4.941201e+07     0\n",
      "4  80.004745  54.366109  8938898.0  42.234760  -29.026579  4.941201e+07     0\n",
      "               lats        lons           x          y     heights  \\\n",
      "10730602  79.999926 -104.185607  11132819.0  43.878681  -78.278702   \n",
      "10730603  79.999923 -104.185614  11132820.0  43.835037 -153.670197   \n",
      "10730604  79.999923 -104.185614  11132820.0  43.833084 -157.039841   \n",
      "10730605  79.999921 -104.185617  11132820.0  43.810215 -196.544846   \n",
      "10730606  79.999921 -104.185617  11132820.0  43.815052 -188.187744   \n",
      "\n",
      "                    dt  conf  \n",
      "10730602  4.941232e+07     0  \n",
      "10730603  4.941232e+07     0  \n",
      "10730604  4.941232e+07     0  \n",
      "10730605  4.941232e+07     0  \n",
      "10730606  4.941232e+07     0  \n",
      "Number of point measurements: 10730607\n"
     ]
    }
   ],
   "source": [
    "## Load IS2 sample data\n",
    "#f_atl03 = data_loc + \"IS2_S2/ATL03_20190805215948_05930404_002_02.h5\"\n",
    "#f_atl03 = data_loc + \"processed_ATL03_20190726213326_04400404_002_01.h5\"\n",
    "f_atl03 = data_loc + \"ATL03_20190726213326_04400404_002_01.h5\"\n",
    "f = h5py.File(f_atl03, 'r')\n",
    "# check to see if it is forward (1)  or backward (0) orientation to know which beam is strong/weak. \n",
    "# (2 is transition phase- don't use these data)\n",
    "print(f['orbit_info/sc_orient'][0])\n",
    "\n",
    "beam = 'gt2l'\n",
    "df03 = rd.getATL03(f,beam)\n",
    "print(df03.head())\n",
    "print(df03.tail())\n",
    "\n",
    "print(\"Number of point measurements:\", len(df03))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of point measurements: 10731\n"
     ]
    }
   ],
   "source": [
    "### Downsample ATL03 to speed up test\n",
    "df03 = df03[::1000]\n",
    "print(\"Number of point measurements:\", len(df03))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Pull in some extra ATL03 params and convert GPS to UTC time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>lats</th>\n",
       "      <th>lons</th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "      <th>heights</th>\n",
       "      <th>dt</th>\n",
       "      <th>conf</th>\n",
       "      <th>time</th>\n",
       "      <th>AT_dist</th>\n",
       "      <th>orbit_number</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>80.004734</td>\n",
       "      <td>54.366124</td>\n",
       "      <td>8938896.0</td>\n",
       "      <td>42.220333</td>\n",
       "      <td>89.935242</td>\n",
       "      <td>4.941201e+07</td>\n",
       "      <td>0</td>\n",
       "      <td>2019-07-26 21:33:25.986627</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1000</th>\n",
       "      <td>80.007749</td>\n",
       "      <td>54.362400</td>\n",
       "      <td>8939241.0</td>\n",
       "      <td>41.681538</td>\n",
       "      <td>12.426127</td>\n",
       "      <td>4.941201e+07</td>\n",
       "      <td>0</td>\n",
       "      <td>2019-07-26 21:33:26.035227</td>\n",
       "      <td>345.0</td>\n",
       "      <td>4802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000</th>\n",
       "      <td>80.008849</td>\n",
       "      <td>54.361042</td>\n",
       "      <td>8939366.0</td>\n",
       "      <td>41.479172</td>\n",
       "      <td>546.315491</td>\n",
       "      <td>4.941201e+07</td>\n",
       "      <td>0</td>\n",
       "      <td>2019-07-26 21:33:26.053327</td>\n",
       "      <td>470.0</td>\n",
       "      <td>4802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3000</th>\n",
       "      <td>80.009568</td>\n",
       "      <td>54.360142</td>\n",
       "      <td>8939448.0</td>\n",
       "      <td>41.564560</td>\n",
       "      <td>750.957275</td>\n",
       "      <td>4.941201e+07</td>\n",
       "      <td>0</td>\n",
       "      <td>2019-07-26 21:33:26.065027</td>\n",
       "      <td>552.0</td>\n",
       "      <td>4802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4000</th>\n",
       "      <td>80.010348</td>\n",
       "      <td>54.359147</td>\n",
       "      <td>8939537.0</td>\n",
       "      <td>42.044792</td>\n",
       "      <td>439.323090</td>\n",
       "      <td>4.941201e+07</td>\n",
       "      <td>0</td>\n",
       "      <td>2019-07-26 21:33:26.077426</td>\n",
       "      <td>641.0</td>\n",
       "      <td>4802</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           lats       lons          x          y     heights            dt  \\\n",
       "0     80.004734  54.366124  8938896.0  42.220333   89.935242  4.941201e+07   \n",
       "1000  80.007749  54.362400  8939241.0  41.681538   12.426127  4.941201e+07   \n",
       "2000  80.008849  54.361042  8939366.0  41.479172  546.315491  4.941201e+07   \n",
       "3000  80.009568  54.360142  8939448.0  41.564560  750.957275  4.941201e+07   \n",
       "4000  80.010348  54.359147  8939537.0  42.044792  439.323090  4.941201e+07   \n",
       "\n",
       "      conf                       time  AT_dist  orbit_number  \n",
       "0        0 2019-07-26 21:33:25.986627      0.0          4802  \n",
       "1000     0 2019-07-26 21:33:26.035227    345.0          4802  \n",
       "2000     0 2019-07-26 21:33:26.053327    470.0          4802  \n",
       "3000     0 2019-07-26 21:33:26.065027    552.0          4802  \n",
       "4000     0 2019-07-26 21:33:26.077426    641.0          4802  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "### Convert GPS time to UTC time\n",
    "epoch = f['/ancillary_data/atlas_sdp_gps_epoch'][0]\n",
    "df03['time'] = Time(epoch + df03['dt'],format='gps').utc.datetime\n",
    "\n",
    "### Calculate along track distance relative to the beginning of the cut segment\n",
    "df03['AT_dist'] = df03.x - df03.x.values[0]\n",
    "\n",
    "### Read orbit number\n",
    "df03['orbit_number'] = [f['/orbit_info/orbit_number'][0]] * len(df03)\n",
    "df03.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8a3276a7afb3427bb7ba84e4e28ce2d6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.colorbar.Colorbar at 0x7fd60d5d3390>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "### Plot data\n",
    "var = 'heights' #choose which variable we want to plot\n",
    "vmin = -10\n",
    "vmax = 30\n",
    "ticks = np.arange(-20,100,5)\n",
    "\n",
    "plt.figure(figsize=(8,8), dpi= 90)\n",
    "ax = plt.axes(projection=ccrs.NorthPolarStereo(central_longitude=0)) # choose polar sterographic for projection\n",
    "ax.coastlines(resolution='50m', color='black', linewidth=1)\n",
    "ax.set_extent([-180, 180, 60, 90], ccrs.PlateCarree())\n",
    "# plt.scatter(df03['lons'][::1000], df03['lats'][::1000],c=df03[var][::1000], cmap='viridis', vmin=vmin,vmax=vmax,transform=ccrs.PlateCarree())\n",
    "plt.scatter(df03['lons'], df03['lats'], c=df03[var], s=1, cmap='viridis', vmin=vmin,vmax=vmax,transform=ccrs.PlateCarree())\n",
    "plt.colorbar(label=var, shrink=0.5, ticks=ticks,extend='both')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<module 'search_sentinels' from '/home/jovyan/leading_to_phytoplankton/scripts/search_sentinels.py'>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "importlib.reload(ss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[0;31mSignature:\u001b[0m\n",
       "\u001b[0mss\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msearch_sentinels\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mplatform_name\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mdf\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0maoi\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mdt\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0muser\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mpwd\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mproj_string\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'+init=EPSG:3995'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mproduct_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mmin_cloud_cover\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mmax_cloud_cover\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mswath_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mf_out\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
       "\u001b[0;31mDocstring:\u001b[0m\n",
       "Search Sentinel-1/2 images overlapping ICESat-2 data within +- dt\n",
       "\n",
       "Parameters: (to be finished!)\n",
       "-----------\n",
       "platform_name : str ['Sentinel-1 | Sentinel-2']\n",
       "    name of the platform for which images will be searched\n",
       "df : panda dataframe\n",
       "    ICESat-2 data\n",
       "aoi: str, list\n",
       "    area of interest as WKT string or bounding box[lllon, lllat, urlon, urlat]\n",
       "dt: int, float\n",
       "    difference in hours between CS2 and S2\n",
       "user : str\n",
       "    username to connect to the Copernicus Scientific Hub\n",
       "pwd : str\n",
       "    password to connect to the Copernicus Scientific Hub\n",
       "proj_string: str\n",
       "    projection string to be used with the pyproj module\n",
       "product_type : str\n",
       "    name of the type of product to be searched (more info at https://scihub.copernicus.eu/userguide/)\n",
       "swath_type : str\n",
       "    name of the type of swath to be searched (Sentinel-1 only, more info at https://scihub.copernicus.eu/userguide/)\n",
       "min_cloud_cover: int, float\n",
       "    Minimum cloud coverage in percentage (Sentinel-2 only)\n",
       "max_cloud_cover: int, float\n",
       "    Maximum cloud coverage in percentage (Sentinel-2 only)        \n",
       "f_out : str\n",
       "    path to file where to write results\n",
       "\n",
       "\n",
       "Returns:\n",
       "--------\n",
       "\u001b[0;31mFile:\u001b[0m      ~/leading_to_phytoplankton/scripts/search_sentinels.py\n",
       "\u001b[0;31mType:\u001b[0m      function\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ss.search_sentinels?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Creating AOI polygon...\n",
      "product_type set to:  GRD\n",
      "swath_type set to:  EW\n",
      "Selecting orbit data inside AOI...\n",
      "N. of orbits/points inside AOI: 1/10731\n",
      "Query for metadata...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "0it [00:00, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "N. of total images: 8\n",
      "Converting time to astropy objects...\n",
      "Looping over orbits to find intersections within 2h...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "1it [00:02,  2.58s/it]\n",
      "1it [00:00, 94.11it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "N. of images within 2h: 6\n",
      "Creating images footprint polygons...\n",
      "Looping over orbits to find intersections...\n",
      "N. of total intersections: 0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "out_s1 = ss.search_sentinels('Sentinel-1', df03, spatial_extent, dt=2, user='adia', pwd='ImageSearchTool2020')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Creating AOI polygon...\n",
      "product_type set to:  S2MSI1C\n",
      "Selecting orbit data inside AOI...\n",
      "N. of orbits/points inside AOI: 1/10731\n",
      "Query for metadata...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Querying products: 100%|██████████| 189/189 [00:01<00:00, 181.69 products/s]\n",
      "0it [00:00, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "N. of total images: 189\n",
      "Converting time to astropy objects...\n",
      "Looping over orbits to find intersections within 1h...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "1it [00:02,  2.66s/it]\n",
      "1it [00:00, 28.06it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "N. of images within 1h: 189\n",
      "Creating images footprint polygons...\n",
      "Looping over orbits to find intersections...\n",
      "N. of total intersections: 13\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "out_s2 = ss.search_sentinels('Sentinel-2', df03, spatial_extent, dt=1, user='adia', pwd='ImageSearchTool2020')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802,\n",
       "  4802],\n",
       " ['S2A_MSIL1C_20190726T220101_N0208_R072_T13XEK_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEL_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEM_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEJ_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMP_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMQ_20190726T234136.SAFE',\n",
       "  'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMR_20190726T234136.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEK_20190726T212235.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEJ_20190726T212235.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEL_20190726T212235.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMP_20190726T212235.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMQ_20190726T212235.SAFE',\n",
       "  'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMR_20190726T212235.SAFE'],\n",
       " [\"https://scihub.copernicus.eu/dhus/odata/v1/Products('62312ee8-c8c9-477c-8022-0317f9307b2c')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('1e709cae-5ecd-438f-9fdf-eb796ad4b089')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('3c873138-16ff-4f82-8f5a-efdd8fe90c26')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('6d6ef139-b9ce-43ec-879f-81816e9b3be9')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('5473ff93-a601-4e82-8d16-fcca7e4267f9')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('cfb172fe-0b93-4a67-a8e6-4bf68526bb99')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('8c29b6ad-0de6-4374-9460-cb6a4065eaa3')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('894874fb-7c54-4eaa-af1b-4a59cfa894e6')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('37b54510-f03f-40c1-b79e-13cc8faa8dc3')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('88ea20a2-8b24-4f75-a939-ec1e1167e1b9')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('716235b5-f21a-4744-a1a1-df003ab0c096')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('f06fe938-1bc3-41f5-8048-a740c120e073')/Products('Quicklook')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('a7803ba8-34b2-42ea-8a14-ed9a8fe48208')/Products('Quicklook')/$value\"],\n",
       " [\"https://scihub.copernicus.eu/dhus/odata/v1/Products('62312ee8-c8c9-477c-8022-0317f9307b2c')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('1e709cae-5ecd-438f-9fdf-eb796ad4b089')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('3c873138-16ff-4f82-8f5a-efdd8fe90c26')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('6d6ef139-b9ce-43ec-879f-81816e9b3be9')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('5473ff93-a601-4e82-8d16-fcca7e4267f9')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('cfb172fe-0b93-4a67-a8e6-4bf68526bb99')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('8c29b6ad-0de6-4374-9460-cb6a4065eaa3')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('894874fb-7c54-4eaa-af1b-4a59cfa894e6')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('37b54510-f03f-40c1-b79e-13cc8faa8dc3')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('88ea20a2-8b24-4f75-a939-ec1e1167e1b9')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('716235b5-f21a-4744-a1a1-df003ab0c096')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('f06fe938-1bc3-41f5-8048-a740c120e073')/$value\",\n",
       "  \"https://scihub.copernicus.eu/dhus/odata/v1/Products('a7803ba8-34b2-42ea-8a14-ed9a8fe48208')/$value\"],\n",
       " [0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  0.41680293597222207,\n",
       "  -0.42264150847222215,\n",
       "  -0.42264150847222215,\n",
       "  -0.42264150847222215,\n",
       "  -0.42264150847222215,\n",
       "  -0.42264150847222215,\n",
       "  -0.42264150847222215],\n",
       " {'62312ee8-c8c9-477c-8022-0317f9307b2c': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEK_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('62312ee8-c8c9-477c-8022-0317f9307b2c')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('62312ee8-c8c9-477c-8022-0317f9307b2c')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('62312ee8-c8c9-477c-8022-0317f9307b2c')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 810.50 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 13, 17, 773000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 14.8656,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.0608809735962,-105.00116 81.00739156148852,-98.69684 80.02905163595373,-99.31195 80.07717728383696,-105.00104 81.0608809735962,-105.00116</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-99.31195 80.02905163595373, -98.69684 81.00739156148852, -105.00116 81.0608809735962, -105.00104 80.07717728383696, -99.31195 80.02905163595373)))',\n",
       "   'tileid': '13XEK',\n",
       "   'hv_order_tileid': 'XK13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEK_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '810.50 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEK_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T13XEK_N02.08',\n",
       "   'uuid': '62312ee8-c8c9-477c-8022-0317f9307b2c'},\n",
       "  '1e709cae-5ecd-438f-9fdf-eb796ad4b089': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEL_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('1e709cae-5ecd-438f-9fdf-eb796ad4b089')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('1e709cae-5ecd-438f-9fdf-eb796ad4b089')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('1e709cae-5ecd-438f-9fdf-eb796ad4b089')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 811.93 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 13, 16, 58000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 3.9491,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.95691940406579,-105.00128 81.89742371407047,-98.006714 80.92029861138599,-98.75702 80.97326367254617,-105.001144 81.95691940406579,-105.00128</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-98.75702 80.92029861138599, -98.006714 81.89742371407047, -105.00128 81.95691940406579, -105.001144 80.97326367254617, -98.75702 80.92029861138599)))',\n",
       "   'tileid': '13XEL',\n",
       "   'hv_order_tileid': 'XL13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEL_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '811.93 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEL_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T13XEL_N02.08',\n",
       "   'uuid': '1e709cae-5ecd-438f-9fdf-eb796ad4b089'},\n",
       "  '3c873138-16ff-4f82-8f5a-efdd8fe90c26': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEM_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('3c873138-16ff-4f82-8f5a-efdd8fe90c26')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('3c873138-16ff-4f82-8f5a-efdd8fe90c26')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('3c873138-16ff-4f82-8f5a-efdd8fe90c26')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 575.02 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 13, 7, 562000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 0.0,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>82.25118701773107,-105.00133 82.29968941421436,-104.07216 82.35131068024857,-103.0202 82.40049510005312,-101.95535 82.44732772763713,-100.878265 82.49160600723829,-99.78888 82.53329797149658,-98.68713 82.5720491364733,-97.572754 82.57930981184336,-97.3439 81.81045512915621,-98.08084 81.86930616823444,-105.00127 82.25118701773107,-105.00133</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-98.08084 81.81045512915621, -97.3439 82.57930981184336, -97.572754 82.5720491364733, -98.68713 82.53329797149658, -99.78888 82.49160600723829, -100.878265 82.44732772763713, -101.95535 82.40049510005312, -103.0202 82.35131068024857, -104.07216 82.29968941421436, -105.00133 82.25118701773107, -105.00127 81.86930616823444, -98.08084 81.81045512915621)))',\n",
       "   'tileid': '13XEM',\n",
       "   'hv_order_tileid': 'XM13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEM_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '575.02 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEM_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T13XEM_N02.08',\n",
       "   'uuid': '3c873138-16ff-4f82-8f5a-efdd8fe90c26'},\n",
       "  '6d6ef139-b9ce-43ec-879f-81816e9b3be9': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEJ_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('6d6ef139-b9ce-43ec-879f-81816e9b3be9')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('6d6ef139-b9ce-43ec-879f-81816e9b3be9')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('6d6ef139-b9ce-43ec-879f-81816e9b3be9')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 515.65 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 13, 5, 956000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 14.503799999999998,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>79.73117512276352,-99.46393 79.72459749055838,-99.59296 79.68142348212659,-100.4003 79.63641303212009,-101.20126 79.58938408435228,-101.99524 79.54037910282086,-102.782196 79.48961695322653,-103.56241 79.43709005862453,-104.33516 79.38957073853369,-105.00098 80.16533661794836,-105.00105 80.11677332676126,-99.26184 79.73117512276352,-99.46393</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-105.00098 79.38957073853369, -104.33516 79.43709005862453, -103.56241 79.48961695322653, -102.782196 79.54037910282086, -101.99524 79.58938408435228, -101.20126 79.63641303212009, -100.4003 79.68142348212659, -99.59296 79.72459749055838, -99.46393 79.73117512276352, -99.26184 80.11677332676126, -105.00105 80.16533661794836, -105.00098 79.38957073853369)))',\n",
       "   'tileid': '13XEJ',\n",
       "   'hv_order_tileid': 'XJ13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEJ_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '515.65 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T13XEJ_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T13XEJ_N02.08',\n",
       "   'uuid': '6d6ef139-b9ce-43ec-879f-81816e9b3be9'},\n",
       "  '5473ff93-a601-4e82-8d16-fcca7e4267f9': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMP_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('5473ff93-a601-4e82-8d16-fcca7e4267f9')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('5473ff93-a601-4e82-8d16-fcca7e4267f9')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('5473ff93-a601-4e82-8d16-fcca7e4267f9')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 466.84 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 13, 1, 11000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 21.0341,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>79.77915478429732,-98.506226 79.7660477471246,-98.77988 79.72459749055838,-99.59296 79.68142348212659,-100.4003 79.63641303212009,-101.20126 79.58938408435228,-101.99524 79.54037910282086,-102.782196 79.48961695322653,-103.56241 79.46553061983546,-103.91675 80.12499092690669,-104.23198 80.16495179276069,-98.48816 79.77915478429732,-98.506226</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-103.91675 79.46553061983546, -103.56241 79.48961695322653, -102.782196 79.54037910282086, -101.99524 79.58938408435228, -101.20126 79.63641303212009, -100.4003 79.68142348212659, -99.59296 79.72459749055838, -98.77988 79.7660477471246, -98.506226 79.77915478429732, -98.48816 80.16495179276069, -104.23198 80.12499092690669, -103.91675 79.46553061983546)))',\n",
       "   'tileid': '14XMP',\n",
       "   'hv_order_tileid': 'XP14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMP_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '466.84 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMP_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T14XMP_N02.08',\n",
       "   'uuid': '5473ff93-a601-4e82-8d16-fcca7e4267f9'},\n",
       "  'cfb172fe-0b93-4a67-a8e6-4bf68526bb99': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMQ_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('cfb172fe-0b93-4a67-a8e6-4bf68526bb99')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('cfb172fe-0b93-4a67-a8e6-4bf68526bb99')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('cfb172fe-0b93-4a67-a8e6-4bf68526bb99')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 808.76 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 11, 49, 871000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 21.5121,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.01643882894953,-104.7478 81.06045689354215,-98.43738 80.07679594322074,-98.492676 80.03719547626906,-104.18622 81.01643882894953,-104.7478</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-104.18622 80.03719547626906, -98.492676 80.07679594322074, -98.43738 81.06045689354215, -104.7478 81.01643882894953, -104.18622 80.03719547626906)))',\n",
       "   'tileid': '14XMQ',\n",
       "   'hv_order_tileid': 'XQ14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMQ_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '808.76 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMQ_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T14XMQ_N02.08',\n",
       "   'uuid': 'cfb172fe-0b93-4a67-a8e6-4bf68526bb99'},\n",
       "  '8c29b6ad-0de6-4374-9460-cb6a4065eaa3': {'title': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMR_20190726T234136',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('8c29b6ad-0de6-4374-9460-cb6a4065eaa3')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('8c29b6ad-0de6-4374-9460-cb6a4065eaa3')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('8c29b6ad-0de6-4374-9460-cb6a4065eaa3')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T22:01:01.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 811.12 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 22, 1, 1, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 27, 2, 11, 24, 631000),\n",
       "   'orbitnumber': 21376,\n",
       "   'relativeorbitnumber': 72,\n",
       "   'cloudcoverpercentage': 3.9344,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.90748103627195,-105.37811 81.95644737476664,-98.37521 80.97284377382584,-98.44281 80.92925761838922,-104.69284 81.90748103627195,-105.37811</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-104.69284 80.92925761838922, -98.44281 80.97284377382584, -98.37521 81.95644737476664, -105.37811 81.90748103627195, -104.69284 80.92925761838922)))',\n",
       "   'tileid': '14XMR',\n",
       "   'hv_order_tileid': 'XR14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMR_20190726T234136.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '811.12 MB',\n",
       "   's2datatakeid': 'GS2A_20190726T220101_021376_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2015-028A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2A',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2A_MSIL1C_20190726T220101_N0208_R072_T14XMR_20190726T234136',\n",
       "   'level1cpdiidentifier': 'S2A_OPER_MSI_L1C_TL_MPS__20190726T234136_A021376_T14XMR_N02.08',\n",
       "   'uuid': '8c29b6ad-0de6-4374-9460-cb6a4065eaa3'},\n",
       "  '894874fb-7c54-4eaa-af1b-4a59cfa894e6': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEK_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('894874fb-7c54-4eaa-af1b-4a59cfa894e6')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('894874fb-7c54-4eaa-af1b-4a59cfa894e6')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('894874fb-7c54-4eaa-af1b-4a59cfa894e6')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 820.75 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 17, 42, 799000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 7.4814,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.0608809735962,-105.00116 81.00739156148852,-98.69684 80.02905163595373,-99.31195 80.07717728383696,-105.00104 81.0608809735962,-105.00116</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-99.31195 80.02905163595373, -98.69684 81.00739156148852, -105.00116 81.0608809735962, -105.00104 80.07717728383696, -99.31195 80.02905163595373)))',\n",
       "   'tileid': '13XEK',\n",
       "   'hv_order_tileid': 'XK13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEK_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '820.75 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEK_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T13XEK_N02.08',\n",
       "   'uuid': '894874fb-7c54-4eaa-af1b-4a59cfa894e6'},\n",
       "  '37b54510-f03f-40c1-b79e-13cc8faa8dc3': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEJ_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('37b54510-f03f-40c1-b79e-13cc8faa8dc3')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('37b54510-f03f-40c1-b79e-13cc8faa8dc3')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('37b54510-f03f-40c1-b79e-13cc8faa8dc3')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 812.71 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 17, 41, 750000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 3.3137999999999996,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>80.16533661794836,-105.00105 80.11677332676126,-99.26184 79.13750293701244,-99.775116 79.18158039729627,-105.00096 80.16533661794836,-105.00105</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-99.775116 79.13750293701244, -99.26184 80.11677332676126, -105.00105 80.16533661794836, -105.00096 79.18158039729627, -99.775116 79.13750293701244)))',\n",
       "   'tileid': '13XEJ',\n",
       "   'hv_order_tileid': 'XJ13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEJ_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '812.71 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEJ_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T13XEJ_N02.08',\n",
       "   'uuid': '37b54510-f03f-40c1-b79e-13cc8faa8dc3'},\n",
       "  '88ea20a2-8b24-4f75-a939-ec1e1167e1b9': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEL_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('88ea20a2-8b24-4f75-a939-ec1e1167e1b9')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('88ea20a2-8b24-4f75-a939-ec1e1167e1b9')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('88ea20a2-8b24-4f75-a939-ec1e1167e1b9')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 660.27 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 17, 17, 625000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 0.0154,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.30290501978128,-105.00119 81.3573463275448,-104.46086 81.43858681329505,-103.6207 81.51799040556077,-102.764404 81.59548923202392,-101.89206 81.67105997822878,-101.00375 81.74470368764328,-100.099884 81.81629919340371,-99.1803 81.88578634360451,-98.245056 81.8979917339932,-98.07352 81.89742371407047,-98.006714 80.92029861138599,-98.75702 80.97326367254617,-105.001144 81.30290501978128,-105.00119</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-98.75702 80.92029861138599, -98.006714 81.89742371407047, -98.07352 81.8979917339932, -98.245056 81.88578634360451, -99.1803 81.81629919340371, -100.099884 81.74470368764328, -101.00375 81.67105997822878, -101.89206 81.59548923202392, -102.764404 81.51799040556077, -103.6207 81.43858681329505, -104.46086 81.3573463275448, -105.00119 81.30290501978128, -105.001144 80.97326367254617, -98.75702 80.92029861138599)))',\n",
       "   'tileid': '13XEL',\n",
       "   'hv_order_tileid': 'XL13E',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEL_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '660.27 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T13XEL_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T13XEL_N02.08',\n",
       "   'uuid': '88ea20a2-8b24-4f75-a939-ec1e1167e1b9'},\n",
       "  '716235b5-f21a-4744-a1a1-df003ab0c096': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMP_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('716235b5-f21a-4744-a1a1-df003ab0c096')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('716235b5-f21a-4744-a1a1-df003ab0c096')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('716235b5-f21a-4744-a1a1-df003ab0c096')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 814.46 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 17, 7, 454000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 5.1106,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>80.12499092690669,-104.23198 80.16495179276069,-98.48816 79.18123126796907,-98.53421 79.1449641306286,-103.76352 80.12499092690669,-104.23198</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-103.76352 79.1449641306286, -98.53421 79.18123126796907, -98.48816 80.16495179276069, -104.23198 80.12499092690669, -103.76352 79.1449641306286)))',\n",
       "   'tileid': '14XMP',\n",
       "   'hv_order_tileid': 'XP14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMP_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '814.46 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMP_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T14XMP_N02.08',\n",
       "   'uuid': '716235b5-f21a-4744-a1a1-df003ab0c096'},\n",
       "  'f06fe938-1bc3-41f5-8048-a740c120e073': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMQ_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('f06fe938-1bc3-41f5-8048-a740c120e073')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('f06fe938-1bc3-41f5-8048-a740c120e073')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('f06fe938-1bc3-41f5-8048-a740c120e073')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 821.65 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 17, 4, 577000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 7.0646,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.01643882894953,-104.7478 81.06045689354215,-98.43738 80.07679594322074,-98.492676 80.03719547626906,-104.18622 81.01643882894953,-104.7478</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-104.18622 80.03719547626906, -98.492676 80.07679594322074, -98.43738 81.06045689354215, -104.7478 81.01643882894953, -104.18622 80.03719547626906)))',\n",
       "   'tileid': '14XMQ',\n",
       "   'hv_order_tileid': 'XQ14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMQ_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '821.65 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMQ_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T14XMQ_N02.08',\n",
       "   'uuid': 'f06fe938-1bc3-41f5-8048-a740c120e073'},\n",
       "  'a7803ba8-34b2-42ea-8a14-ed9a8fe48208': {'title': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMR_20190726T212235',\n",
       "   'link': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('a7803ba8-34b2-42ea-8a14-ed9a8fe48208')/$value\",\n",
       "   'link_alternative': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('a7803ba8-34b2-42ea-8a14-ed9a8fe48208')/\",\n",
       "   'link_icon': \"https://scihub.copernicus.eu/dhus/odata/v1/Products('a7803ba8-34b2-42ea-8a14-ed9a8fe48208')/Products('Quicklook')/$value\",\n",
       "   'summary': 'Date: 2019-07-26T21:10:39.024Z, Instrument: MSI, Mode: , Satellite: Sentinel-2, Size: 643.64 MB',\n",
       "   'datatakesensingstart': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'beginposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'endposition': datetime.datetime(2019, 7, 26, 21, 10, 39, 24000),\n",
       "   'ingestiondate': datetime.datetime(2019, 7, 26, 23, 16, 44, 486000),\n",
       "   'orbitnumber': 12467,\n",
       "   'relativeorbitnumber': 143,\n",
       "   'cloudcoverpercentage': 0.0165,\n",
       "   'sensoroperationalmode': 'INS-NOBS',\n",
       "   'gmlfootprint': '<gml:Polygon srsName=\"http://www.opengis.net/gml/srs/epsg.xml#4326\" xmlns:gml=\"http://www.opengis.net/gml\">\\n   <gml:outerBoundaryIs>\\n      <gml:LinearRing>\\n         <gml:coordinates>81.30729048359284,-104.95766 81.3573463275448,-104.46086 81.43858681329505,-103.6207 81.51799040556077,-102.764404 81.59548923202392,-101.89206 81.67105997822878,-101.00375 81.74470368764328,-100.099884 81.81629919340371,-99.1803 81.87570294019706,-98.38077 80.97284377382584,-98.44281 80.92925761838922,-104.69284 81.30729048359284,-104.95766</gml:coordinates>\\n      </gml:LinearRing>\\n   </gml:outerBoundaryIs>\\n</gml:Polygon>',\n",
       "   'footprint': 'MULTIPOLYGON (((-104.69284 80.92925761838922, -98.44281 80.97284377382584, -98.38077 81.87570294019706, -99.1803 81.81629919340371, -100.099884 81.74470368764328, -101.00375 81.67105997822878, -101.89206 81.59548923202392, -102.764404 81.51799040556077, -103.6207 81.43858681329505, -104.46086 81.3573463275448, -104.95766 81.30729048359284, -104.69284 80.92925761838922)))',\n",
       "   'tileid': '14XMR',\n",
       "   'hv_order_tileid': 'XR14M',\n",
       "   'format': 'SAFE',\n",
       "   'processingbaseline': '02.08',\n",
       "   'platformname': 'Sentinel-2',\n",
       "   'filename': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMR_20190726T212235.SAFE',\n",
       "   'instrumentname': 'Multi-Spectral Instrument',\n",
       "   'instrumentshortname': 'MSI',\n",
       "   'size': '643.64 MB',\n",
       "   's2datatakeid': 'GS2B_20190726T211039_012467_N02.08',\n",
       "   'producttype': 'S2MSI1C',\n",
       "   'platformidentifier': '2017-013A',\n",
       "   'orbitdirection': 'ASCENDING',\n",
       "   'platformserialidentifier': 'Sentinel-2B',\n",
       "   'processinglevel': 'Level-1C',\n",
       "   'identifier': 'S2B_MSIL1C_20190726T211039_N0208_R143_T14XMR_20190726T212235',\n",
       "   'level1cpdiidentifier': 'S2B_OPER_MSI_L1C_TL_SGS__20190726T212235_A012467_T14XMR_N02.08',\n",
       "   'uuid': 'a7803ba8-34b2-42ea-8a14-ed9a8fe48208'}})"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out_s2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:notebook] *",
   "language": "python",
   "name": "conda-env-notebook-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
